package kz.edu.sdu.itech.pcs.server;

import kz.edu.sdu.itech.pcs.common.Message;

public class MessageToMonitor extends Message {
   Monitor monitor;

   public MessageToMonitor(Monitor worker) {
      this.monitor = worker;
   }

   public boolean send() {
      boolean ok = true;
      try {
         monitor.out.println(toString());
         monitor.out.flush();
         if (AppProps.DEBUG)
            Monitor.log.debug(String.format("send to monitor: %s", toString()));
      } catch (Exception e) {
         e.printStackTrace();
         ok = false;
      }
      return ok;
   }
}
